<form action="<?php e_action("serviceModifySubmit"); ?>" method="post"  enctype="multipart/form-data">
    <input type="hidden" name="id" id="id" value="<?php echo $r['id']?>"/>
    <input type="hidden" name="address_id" id="address_id" value="<?php echo $r['address_id'];?>"/>
    <fieldset>
        <legend>负责人基本信息</legend>
        <label for="real_name">负责人姓名</label>
        <input type="text" name="real_name" id="real_name" value="<?=$r['real_name'];?>" placeholder="请输入负责人姓名"/><br/>
        <label for="sex">性别</label>
        <input type="radio" name="sex" id="sex" value="male" <?php if($r['sex']=='male') echo 'checked';?>>男
        <input type="radio" name="sex" id="sex" value="female" <?php if($r['sex']=='female') echo 'checked';?>>女<br/>
        <label for="birth">出生日期</label>
        <input type="date" name="birth" id="birth" value="<?=$r['birth'];?>" /><br/>
        <label for="nation">民族</label>
        <input type="text" name="nation" id="nation" value="<?=$r['nation'];?>" placeholder="请输入民族"/><br/>
        <label for="tel">联系方式</label>
        <input type="text" name="tel" id="tel" value="<?=$r['tel'];?>" placeholder="请输入联系方式"/><br/>
        <label for="email">邮箱</label>
        <input type="text" name="email" id="email" value="<?=$r['email'];?>" placeholder="请输入邮箱"/><br/>
        <label for="academic">学历</label>
        <input type="text" name="academic" id="academic" value="<?=$r['academic'];?>" placeholder="请输入学历"/><br/>
        <label for="address">现居地址</label>
        <input type="text" name="address" id="address" value="<?=$r['address'];?>" placeholder="请输入现居地址"/><br/>
        <label for="computer_skill">电脑水平</label>
        <input type="text" name="computer_skill" id="computer_skill" value="<?=$r['computer_skill'];?>" placeholder="请输入电脑水平"/><br/>
        <label for="idnum">身份证号码</label>
        <input type="text" name="idnum" id="idnum" value="<?=$r['idnum'];?>" placeholder="请输入身份证号码"/><br/>
        <label for="idnum_pic">身份证照片</label>
        <img width="180" src="<?php if(is_array($r['idnum_pic'])){foreach($r['idnum_pic'] as $v){ echo $v['url'];?><?php }?><?php }else echo $r['idnum_pic']?>"/><br/>

<!--        <img  width="200" src="--><?php //foreach($r['idnum_pic'] as $v){?><!-- --><?php //echo $v['url']; }?><!--" alt=""/><br/>-->
        <label for="resume">个人简历</label>
        <textarea name="resume" id="resume" ><?=$r['resume'];?></textarea><br/>
        <label for="header_name">上级负责人姓名</label>
        <input type="text" name="header_name" id="header_name" value="<?=$r['header_name'];?>" placeholder="请输入上级负责人姓名"/><br/>
        <label for="header_tel">上级负责人电话</label>
        <input type="text" name="header_tel" id="header_tel" value="<?=$r['header_tel'];?>" placeholder="请输入上级负责人电话"/><br/>
    </fieldset>
    <fieldset>
        <legend>服务站基本信息</legend>
        <label for="service_name">服务站名称</label>
        <input type="text" name="service_name" id="service_name" value="<?=$r['service_name'];?>" placeholder="请输入服务站名称"/><br/>
        <label for="facade_pic">门面照片</label>
<!--        <img width="200" src="--><?php //foreach($r['facade_pic'] as $v){?><!-- --><?php //echo $v['url']; }?><!--" alt=""/><br/>-->
        <img width="180" src="<?php if(is_array($r['facade_pic'])){foreach($r['facade_pic'] as $v){ echo $v['url'];?><?php }?><?php }else echo $r['facade_pic']?>"/><br/>

        <label for="service_address">服务站地址</label>
        <div class="js-select-address-box" style="display:inline-block">
            <select class="js-select-address"></select>    
        </div>
        <input type="text" name="service_address" id="service_address" readonly value="<?=$r['service_address'];?>"/><button class="update-address">修改</button> <br/>
        <label for="address_text">服务站地址备注</label>
        <input type="text" name="address_text" id="address_text" value="<?=$r['address_text'];?>" placeholder="请输入服务站地址备注"/> <br/>
<!--        <label for="longitude">服务站经度</label>-->
<!--        <input type="text" name="longitude" id="longitude" value="--><?//=$r['longitude'];?><!--" placeholder="请输入服务站经度"/><br/>-->
<!--        <label for="latitude">服务站纬度</label>-->
<!--        <input type="text" name="latitude" id="latitude" value="--><?//=$r['latitude'];?><!--" placeholder="请输入服务站纬度"/><br/>-->
<!--        <label for="comment">评论数</label>-->
<!--        <input type="text" name="comment" id="comment" readonly value="--><?//=$r['comment'];?><!--"/> <br/>-->
<!--        <label for="score">评分</label>-->
<!--        <input type="text" name="score" id="score" readonly value="--><?//=$r['score'];?><!--"/>-->
    </fieldset>
    <fieldset>
        <legend>地图选择(拖拽地图地图中的标志设置)</legend>
        <label for="longitudeInput">商城经度</label>
        <input type="text" name="longitude" id="longitudeInput" value="<?=$r['longitude'];?>" readonly placeholder="拖拽地图地图中的标志设置经度"/>
        <br/>
        <label for="latitudeInput">商城纬度</label>
        <input type="text" name="latitude" id="latitudeInput" value="<?=$r['latitude'];?>" readonly placeholder="拖拽地图地图中的标志设置纬度"/>
        <br/>
        <div id="allmap" style="margin-left:15px;width:600px;height:320px;"></div>
    </fieldset>
    <input type="submit" value="保存">
</form>
<script src="plugin/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
    _root = "<?php echo $system['siteRoot'];?>";
</script>
<script type="text/javascript" src="script/api.js"></script>
<script type="text/javascript" src="script/simpleAddress.js"></script>
<script type="text/javascript">
    $(function(){
        var select = $(".js-select-address-box").hide();
        var input  = $("#service_address").show();
        var button = $(".update-address").show();
        button.click(function(e){
            e.preventDefault()
            select.show();
            input.hide();
            button.hide()
            $('#address_id').remove();
        })
    })
</script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=HNtF8PpKdoLMQTDurEuZUVTE"></script>
<script type="text/javascript">
    var map = new BMap.Map("allmap");
    map.addControl(new BMap.NavigationControl());
    map.enableScrollWheelZoom();    //启用滚轮放大缩小
    map.enableContinuousZoom();    //启用地图惯性拖拽
    //map.setZoom(10);
    var longitude=Number($("[name=longitude]").val()) || 117.565297;
    if(longitude>120|| longitude<115) longitude=117.565297;
    var latitude=Number($("[name=latitude]").val()) || 33.547786;
    if(latitude>35|| latitude<30) latitude=33.547786;
    var point = new BMap.Point(longitude,latitude);
    map.centerAndZoom(point,13);
    var marker = new BMap.Marker(point);
    map.addOverlay(marker);
    marker.enableDragging();
    marker.addEventListener("dragend", function(e){
        var p = e.point;
        $("[name=latitude]").val(p.lat);
        $("[name=longitude]").val(p.lng);
    });
</script>